<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/basic_form_style.css" rel="stylesheet" type="text/css" />
<link href="css/table_style1.css" rel="stylesheet" type="text/css" />
<script src="jquery/js/jquery-1.7.2.min.js"></script>
<style type="text/css">
.subHead{text-align:center}
</style>

<script type="text/javascript">
	function addNewStudent()
	{	var first_name=document.getElementById('first_name').value;
		var last_name=document.getElementById('last_name').value;
		var id=document.getElementById('student_id').value;
		var adress=document.getElementById('adress').value;
		var phone=document.getElementById('phone').value;
		var email=document.getElementById('email').value;
		if( first_name=="" || last_name=="" || id == "" || adress==""|| phone=="" || email=="")
			alert("Plaese fill all the fieldes !!!"); 
		else{
			$.post("content/find_ajax.php",{s:2, fName:first_name, lName:last_name,Id:id, Adress:adress, Phone:phone , Email:email},function(data){document.getElementById('toReplace').innerHTML =data});
		}
	
	}
</script>
</head>

<body>
<center>
    <table width="724" height="340" border="0" >
      <tr>
        <td colspan="4" > <center><h1 class="primeHead">Add New Student</h1></center></td>
      </tr>
      <form id="form1" name="form1" method="post" action="">
          <tr>
            <td width="173" class="subHead">First Name :</td>
            <td width="176"><label for="first_name"></label>
            <input type="text" name="first_name" id="first_name" /></td>
            <td width="158" class="subHead">Last Name :</td>
            <td width="199"><label for="last_name"></label>
            <input type="text" name="last_name" id="last_name" /></td>
          </tr>
          <tr>
            <td class="subHead">Id : </td>
            <td><label for="student_id"></label>
            <input type="text" name="student_id" id="student_id" /></td>
            <td class="subHead">Adress :</td>
            <td><label for="adress"></label>
            <input type="text" name="adress" id="adress" /></td>
          </tr>
          <tr>
            <td class="subHead">Phone :</td>
            <td><label for="phone"></label>
            <input type="text" name="phone" id="phone" /></td>
            <td class="subHead">Email :</td>
            <td><label for="email"></label>
            <input type="text" name="email" id="email" /></td>
          </tr>
          <tr>
            <td colspan="4"><input style="margin-left:570px; font-size:17px;" type="submit" class="TriggerButton" name="addStudent" id="addStudent" value="Add Student" onclick="addNewStudent();return false;" /></td>
          </tr>
      </form>
      <tr><td colspan="4">
	      <center><h1 id="toReplace">Results will be shown here</h1></center>
      </td></tr>
    </table>
</center>
</body>
</html>